<template>
	<div class="school">
		<h2>我是School组件</h2>
		<h3>学校名：{{name}}</h3>
		<button @click="sendNameToApp">把学校名传给App</button>
	</div>
</template>

<script>
	export default {
		name:'School',
		data() {
			return {
				name:'尚硅谷'
			}
		},
		methods: {
			sendNameToApp(){
				//触发haha这个自定义事件
				this.$emit('haha',this.name)
			}
		},
	}
</script>

<style scoped>
	.school {
		background-color: skyblue;
		padding: 20px;
	}
</style>